﻿GAME_NFRAME=..
GAME_SRC_PATH=../../../..


# 检测操作系统类型
ifeq ($(OS),Windows_NT)
    # Windows系统下的规则
    IS_WINDOWS = 1
else
    # Linux系统下的规则
    IS_LINUX = 1
endif

GAME_INSTALL_PATH=${GAME_SRC_PATH}/Install
GAME_BIN_PATH=${GAME_INSTALL_PATH}/Bin
GAME_DATA_PATH=${GAME_INSTALL_PATH}/Config/Data
GAME_SQL_PATH=${GAME_INSTALL_PATH}/Sql
GAME_BUILD_PATH=${GAME_SRC_PATH}/Build/NFComm/makefile

MAKEFILE_PATH=${GAME_SRC_PATH}/src/NFrame/NFComm/makefiles
MAKE_PROTOC_GEN=${MAKEFILE_PATH}/protoc_gen.makefile
MAKE_EXCEL_GEN=${MAKEFILE_PATH}/excel_gen.makefile
MAKE_SQL_GEN=${MAKEFILE_PATH}/sql_gen.makefile

RESDB_EXCEL_PATH=${GAME_SRC_PATH}/Excel
PROTOCGEN_FILE_PATH=${GAME_BUILD_PATH}/temp

THIRD_PARTY_PATH=${GAME_SRC_PATH}/thirdparty
THIRD_PARTY_TOOLS_PATH=${THIRD_PARTY_PATH}/tools
THIRD_PARTY_INC_PATH=${THIRD_PARTY_PATH}/
ifeq ($(IS_WINDOWS), 1)
NANOPB_PLUGIN=..\..\..\..\thirdparty\nanopb\generator\protoc-gen-nanopb.bat
else
NANOPB_PLUGIN=${THIRD_PARTY_PATH}/nanopb/generator/protoc-gen-nanopb
endif
NANOPB_PLUGIN_PROTO=${THIRD_PARTY_PATH}/nanopb/generator/proto

TOOLS_PATH=${GAME_SRC_PATH}/tools
THIRD_PARTY_TOOLS_PATH=${TOOLS_PATH}
PROTOC=${TOOLS_PATH}/protoc
ifeq ($(IS_WINDOWS), 1)
NFEXCELPROCESS=${TOOLS_PATH}/NFExcelProcess.exe
else
NFEXCELPROCESS=${TOOLS_PATH}/NFExcelProcess
endif

FILE_COPY_EXE=${NFEXCELPROCESS}

MAKE_SINGLE_JOB_NUM=4

#######################
#protocol define
#######################

PROTOCOL_PATH=${GAME_SRC_PATH}/src/NFrame/NFComm/Message

PROTOCOL_NANOPB_XML=${NANOPB_PLUGIN_PROTO}/nanopb.proto
PROTOCOL_NANOPB_H=${PROTOCGEN_FILE_PATH}/nanopb.pb.h
PROTOCOL_NANOPB_CPP=${PROTOCGEN_FILE_PATH}/nanopb.pb.cc

PROTOCOL_FRAME_XML=$(wildcard ${PROTOCOL_PATH}/*.proto)
PROTOCOL_FRAME_H=$(subst $(PROTOCOL_PATH),$(PROTOCGEN_FILE_PATH),$(PROTOCOL_FRAME_XML:.proto=.pb.h))
PROTOCOL_FRAME_NANOPB_H=$(subst $(PROTOCOL_PATH),$(PROTOCGEN_FILE_PATH),$(PROTOCOL_FRAME_XML:.proto=.nanopb.h))
PROTOCOL_FRAME_CC=$(subst $(PROTOCOL_PATH),$(PROTOCGEN_FILE_PATH),$(PROTOCOL_FRAME_XML:.proto=.pb.cc))
PROTOCOL_FRAME_NANOPB_CC=$(subst $(PROTOCOL_PATH),$(PROTOCGEN_FILE_PATH),$(PROTOCOL_FRAME_XML:.proto=.nanopb.cc))

ALL_PROTOCGEN_FILE=${PROTOCOL_FRAME_H} ${PROTOCOL_FRAME_NANOPB_H} ${PROTOCOL_FRAME_CC} ${PROTOCOL_FRAME_NANOPB_CC} ${PROTOCOL_NANOPB_H} ${PROTOCOL_NANOPB_CPP}
NEW_PROTOCGEN_KERNEL_FILE_PATH=${GAME_SRC_PATH}/src/NFrame/NFComm/NFKernelMessage

##########################
#
##########################
MAKE_COMPILE_LOG=${GAME_BUILD_PATH}/make_compile.log
MAKE_COMPILE_WARNING_LOG=${GAME_BUILD_PATH}/make_warning.log
MAKE_COMPILE_ERROR_LOG=${GAME_BUILD_PATH}/make_error.log
MAKE_DEPENDENT_LOG=${GAME_BUILD_PATH}/make_dependent.log
MAKE_DEPENDENT_ERROR_LOG=${GAME_BUILD_PATH}/make_dependent_error.log
MAKE_LINK_ERROR_LOG=${GAME_BUILD_PATH}/make_link_error.log

NEED_CLEAN_FILES=
